#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
//class A {
//public:
//	A(const char* s) { cout << s << endl; }
//	~A() {}
//};
//class B :public A
//{
//public:
//	B(const char* s1, const char* s2) :A(s1) { cout << s2 << endl; }
//};
//class C :public A
//{
//public:
//	C(const char* s1, const char* s2) :A(s1) { cout << s2 << endl; }
//};
//class D :public B, public C
//{
//public:
//	D(const char* s1, const char* s2, const char* s3, const char* s4) :B(s1, s2), C(s1, s3)
//	{
//		cout << s4 << endl;
//	}
//};
//int main() {
//	D* p = new D("class A", "class B", "class C", "class D");
//	delete p;
//	return 0;
//}
//
//int main()
//{
//	char a = 'a';
//	string st;
//	st += a;
//	cout << st << endl;
//	return 0;
//}
int main()
{
    string st1, st2;
    int count = 1;
    getline(cin, st1);
    int i = 0;
    for (int j = 0; j < st1.size(); i++)
    {
        if (st1[i] == ' ')
        {
            count++;
        }
    }
    cout << count << endl;
    while (i != st1.size())
    {
        if (st1[i] != ' ')
        {
            st2 += st1[i];
            i++;
        }
        else
        {
            cout << st2 << endl;
            st2.clear();
            i++;

        }
    }
    cout << st2;
    return 0;
}